package com.ican.oc.dao;

import org.springframework.stereotype.Repository;

import com.ican.oc.common.hibernate.OcHibernateDao;
import com.ican.oc.domain.OcOptionValueDescription;

@Repository("ocOptionValueDescriptionDao")
public class OcOptionValueDescriptionDao extends OcHibernateDao<OcOptionValueDescription, Integer> {

    public OcOptionValueDescription findOptionValueDescByValueCodeAndLang(Integer optionId, String name, Integer langId) {
        String hql = "from OcOptionValueDescription where optionId = ? and name = ? and pk.languageId = ?";
        return findUnique(hql, new Object[]{optionId, name, langId});
    }
    
    public OcOptionValueDescription findOptionValueDescByValueAndLang(Integer id, String name, Integer langId) {
        String hql = "from OcOptionValueDescription where pk.optionValueId = ? and name = ? and pk.languageId = ?";
        return findUnique(hql, new Object[]{id, name, langId});
    }
}
